package com.nycreativity.elecreativity.entity.po

import com.baomidou.mybatisplus.annotation.IdType
import com.baomidou.mybatisplus.annotation.TableId
import com.baomidou.mybatisplus.annotation.TableName
import com.nycreativity.elecreativity.entity.BaseEntity
import java.math.BigDecimal
import java.time.LocalDateTime

/**
 * @description 订单
 * @author sxt
 * @date 2021/3/14 2:25 下午
 * @version 1.0
 */
@TableName("`order`")
class Order(
    /**
     * id
     */
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    var id: Long? = null,

    /**
     * 创建者id
     */
    override var creator: Long? = null,

    /**
     * 订单状态，0：待付款，1：待收货，2：待签收，3：已收货
     */
    var status: Int? = null,

    /**
     * 创建时间
     */
    override var createTime: LocalDateTime? = null,

    /**
     * 订单支付方式
     */
    var paymentMethod: Int? = null,

    /**
     * 支付内部id
     */
    var paymentInnerId: String? = null
) :
    BaseEntity() {

    /**
     * 快递单号
     */
    var expressNum: String? = null

    /**
     * 订单总金额
     */
    var totalAmount: BigDecimal = BigDecimal(0)

    /**
     * 订单总金额(美元表示)
     */
    var amountUsd: BigDecimal = BigDecimal(0)


    override fun toString(): String {
        return "Order{" +
                "id=" + id +
                ", expressNum=" + expressNum +
                ", paymentMethod=" + paymentMethod +
                ", paymentInnerId=" + paymentInnerId +
                ", totalAmount=" + totalAmount +
                ", amountUsd=" + amountUsd +
                ", status=" + status +
                ", ${super.toString()}}"
    }


}